#ifndef NODE_H_
#define NODE_H_

#include <e32def.h>
#include <e32cmn.h>

namespace DOM
{
class Node
{
public:
	enum ENodeType
	{
		NTDocument,
		NTElement,
		NTComment,
		NTStyle,
		NTEnd
	};
	
	enum ETagType
	{
		TTBegin,
		TTEnd,
		TTBoth
	};
public:
	Node();
	virtual ~Node();
	
private:
	Node* iFirstChild;
	Node* iLastChild;
	Node* iNextSibling;
	Node* iPreSibling;
	
public:
	virtual TInt NodeType() = 0;
	TInt TagType() const {return iTagType;}
	void SetTagType(ETagType type) {iTagType = type;}
public:
	Node* NextSibling() const {return iNextSibling; }
	Node* PreSibling() const {return iPreSibling; }
	Node* FirstChild() const {return iFirstChild; }
	Node* LastChild() const {return iLastChild; }
	void setNextSibling(Node* aNode) {iNextSibling = aNode; }
	void setPreSibling(Node* aNode) {iPreSibling = aNode; }
	void setFirstChild(Node* aNode) {iFirstChild = aNode; }
	void setLastChild(Node* aNode) {iLastChild = aNode; }
	
	void AppendChild(Node* aChild);
	static Node* CreateNodeL(const TDesC& aDes);
	
	void TagName(TDes aBuf);
	void SetTagNameL(const TDesC& aTagName);
private:
	HBufC* iTagName;
	ETagType iTagType;
};
}
#endif /*NODE_H_*/
